$(function(){
layui.use(['form','layer','util','laypage'], function(){
				var form = layui.form;
				form.render();
				var util=layui.util;
				var total;
				var laypage=layui.laypage;
				function find_log_list(page,rows){
					var index;
				$.ajax({
					type:"get",
					url:"http://localhost:8080/ssmService/operationLog/selectPageOperationLog",
					async:false,
					data:{
							"queryParams.curr_page": page,
				    		"queryParams.page_size": rows
					},
					"beforSend":function(){
						index=layer.load(1,{
							shade:[0.5,"black"]
						});
					},
					"success":function(result){
						if(result.resultCode==0){
						build_log_list(result);
						total=result.data.total;
						}else{
					 		layer.msg("服务器错误，请联系管理员",{
									icon:2,
									time:1000
							});
				
	} 
	} 
		});			
				}
				
			function build_log_list(result){ 
					var logList =result.data.list;
					$(".tbody").empty();
					$.each(logList, function(index,item) {
						var tr=$("<tr></tr>");
						var td1=$("<td></td>").text(item.user_account);
						var td2=$("<td></td>").text(item.user_name);
						
						var td3=$("<td></td>").text(item.request_ip);
						var type=["pc端","手机端"]
						var td4=$("<td></td>").text(util.toDateString(item.date,"yyyy-MM-dd HH:mm:ss"));
						
						var state=["登录失败","登录成功"]
						var td5=$("<td></td>").text(item.module);
						var td6=$("<td></td>").text(item.type);
						var td7=$("<td></td>").text(item.content);
						var imei="";
						if(item.imei!=null){
							imei=item.imei;
						}
						var td7=$("<td></td>").text(imei);
						tr.append(td1).append(td2).append(td3).append(td4).append(td5).append(td6).append(td7).appendTo(".tbody");
										});
			}
			find_log_list(1,10);
			laypage.render({
				elem:"table_page",
				count:total,
				layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
				jump:function(obj,first){
					if(!first){
						find_log_list(obj.curr,obj.limit);
					}
				}
			});
			
			});
		});